2020-2021 Sunseeker Telemetry and Lighting System
mpy32_ex3_16bitSignedMultiply.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Functions

void main (void)
 

Variables

int16_t multiplier = 0x1234
 
int16_t operand = -6578
 
int64_t Result
 

Function Documentation

◆ main()

void main ( void  )

Definition at line 68 of file mpy32_ex3_16bitSignedMultiply.c.

References __no_operation(), multiplier, operand, and Result.

Variable Documentation

◆ multiplier

int16_t multiplier = 0x1234

MPY - 16x16 Signed Multiply

Hardware multiplier is used to multiply two numbers. The calculation is automatically initiated after the second operand is loaded. Results are stored in RESLO, RESHI and SUMEXT = FFFF if result is negative, SUMEXT = 0 otherwise. Result is also stored as Result variable.

ACLK = 32.768kHz, MCLK = SMCLK = default DCO

Tested On: MSP430F5438A,MSP430FR5739,MSP430FR5969,MSP430FR2433

/ |
RST

| | | |

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • MPY peripheral

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • NONE

Definition at line 64 of file mpy32_ex3_16bitSignedMultiply.c.

◆ operand

int16_t operand = -6578

Definition at line 65 of file mpy32_ex3_16bitSignedMultiply.c.

◆ Result

int64_t Result

Definition at line 66 of file mpy32_ex3_16bitSignedMultiply.c.